# 1. 写函数,输⼊⼀个数字，传递到函数中，输出从1到此数
# def getAsc(n1) :
#     for i in range(1,(n1+1)) :
#         print(i)
# getAsc(10)

# 2. 写函数,接收n个数字,返回这些数字的和、最⼩值、最⼤值
# def getResult(*n) :
#     sum1=sum(n)
#     max1=max(n)
#     min1=min(n)
#     return sum1,max1,min1
# result=print(getResult(5,10,9))

# 3. 写函数，接收⼀个不定⻓参数，为多个字符串，判断每个字符串的⻓度是否为⼤于5，如：isLen5("hello","worldd","test") 返回[False,True,False]
# 注：使⽤推导式
# def isLen5(*n) :
#     return[len(i) > 5 for i in n]
# print(isLen5("hello","worldd","test"))

# 4. 写函数，传⼊两个列表参数,返回⼀个扑克牌列表,⾥⾯有52项,每⼀项都是⼀个tuple
# list1=["红⼼","梅花","⽅块","⿊桃"]
# list2=["A","2","3","4","5","6","7","8","9","10","j","q","k"]
# 结果输出如:[('红⼼','A'),('梅花','A')…('⿊桃','k')]
# 注：使⽤推导式

# list1=["红⼼","梅花","⽅块","⿊桃"]
# list2=["A","2","3","4","5","6","7","8","9","10","j","q","k"]
# def getPoker(l1,l2) :
#     tuple1=[(l1[0],i) for i in l2]
#     tuple2=[(l1[1],i) for i in l2]
#     tuple3=[(l1[2],i) for i in l2]
#     tuple4=[(l1[3],i) for i in l2]
#     list3=tuple1+tuple2+tuple3+tuple4
#     print(list3)
# getPoker(list1,list2)

# def getPoker(l1,l2) :
#     poker=[(i,j) for i in l1 for j in l2]
#     return poker
# print(getPoker(list1,list2))

# # 5. 编写printstar(x)函数，(x是⼤于1的奇数数字)，忽略边框。
# def printstar(n) :
#     for i in range(1,(n-1)//2+1) :
#         for j in range(1,(n-1)//2+1):
#             print("* ",end="")
#         print("",end="\n")
# printstar(9)
# def printstar(n) :
#     if n%2==1 and n > 1:
#         le=int((n+1)/2)
#     for i in range(1,(le+1)) :
#         print("* "*(le-i),end="  ")
#         print("  "*(2*i-1),end="  ")
#         print("* "*(le-i))
#     for i in range((le-1),0,-1) :
#         print("* "*(le-i),end="  ")
#         print("  "*(2*i-1),end="  ")
#         print("* "*(le-i))
#     else :
#         print('请输入大于1的奇数')
# n=7
# printstar(n)

# def getPlusMinusMul(n1,n2):
# 		sum=n1+n2
# 		dif=n1-n2
# 		mul=n1*n2
# 		return sum,dif,mul
# result=getPlusMinusMul(5,2)
# print(result)


# def getlen(n1,**n):    # 确定的放前面，不确定的放后面
# 		print(n)
# 		print(len(n))
# getlen(43,sno=65,sname=67,stest="hello") # 这种是字典的写法

# def update(x) :
#     x=x+10 # 创建新对象，不改变原始值
#     print("函数为:",x) # 输出15
    
# num=5
# update(num)
# print("函数外:",num) # 输出5，原始值未因函数而改变

def append_list(l1) :
		l1.append(4)
list1=[1,2,3]
append_list(list1)
print(list1)